﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UIT.Controls;
using System.Windows.Markup;
using UIT.Commands;

namespace UIT.Controls
{
#if !SILVERLIGHT
	[RuntimeNameProperty("Id")]
#endif
	[ContentProperty("Text")]
	public class Button : DrawableControl, ICommander
	{
		private string text;

		public string Text
		{
			get { return text; }
			set
			{
				text = value;
				OnPropertyChanged("Text");
			}
		}

		public bool IsDefault { get; set; }

		public event EventHandler Click;

		public void RaiseClick()
		{
			if (Click != null)
				Click(this, EventArgs.Empty);
		}

		public override bool IsContainer
		{
			get { return false; }
		}

		public override ControlType Type
		{
			get { return ControlType.Button; }
		}

		#region ICommander Members

		public string Command
		{
			get;
			set;
		}

		public object Argument
		{
			get;
			set;
		}

		#endregion
	}
}
